<template>
  <div class="apply">
    <el-form class="oldIndent_nav" ref="dataForm">
      <div style="margin-bottom:20px;padding-top:10px;">
        <span style="margin-left:60px">服务项目：</span>
        <el-select v-model="value" placeholder="请选择">
          <el-option
            v-for="item in options "
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
        <span style="margin-left:50px">日期:</span>
        <el-date-picker
          type="date"
          placeholder="选择时间"
          format="yyyy 年 MM 月 dd 日"
          :picker-options="pickerOptions0"
          value-format="yyyyMMdd"
        ></el-date-picker>
        <span style="margin-left:60px">时间段：</span>
        <el-select v-model="values" placeholder="请选择">
          <el-option
            v-for="item in optionss"
            :key="item.values"
            :label="item.label"
            :value="item.values"
          ></el-option>
        </el-select>
      </div>
      <div>
        <span style="margin-left:60px">姓名：</span>
        <el-input placeholder="请输入姓名" style="width:200px"></el-input>
        <span style="margin-left:60px">身份证：</span>
        <el-input placeholder="请输入身份证" style="width:200px"></el-input>
        <span style="margin-left:60px">姓名：</span>
        <el-input placeholder="请输入姓名" style="width:200px"></el-input>
        <el-button type="primary" round style="float:right;margin-right:200px">查询</el-button>
      </div>
      <el-button class="add" type="primary" style="float:left;margin:12px;" @click="creat">添加一条</el-button>
    </el-form>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="preid" align="center" label="预约编号"></el-table-column>
      <el-table-column prop="pbCode" align="center" label="排班编号"></el-table-column>
      <el-table-column prop="date" align="center" label="预约时间"></el-table-column>
      <el-table-column prop="name" align="center" label="姓名"></el-table-column>
      <el-table-column prop="phoneNum" align="center" label="联系方式"></el-table-column>
      <el-table-column prop="certNum" width="220" align="center" label="身份证"></el-table-column>
      <el-table-column prop="timePart" align="center" label="时间段"></el-table-column>
      <el-table-column prop="active" align="center" label="绿通项目"></el-table-column>
      <el-table-column prop="empid" align="center" label="操作员编号"></el-table-column>
      <el-table-column prop="platform" align="center" label="操作平台"></el-table-column>
       <el-table-column label="操作" width="200" align="center">
        <template slot-scope="scope">
          <el-button size="mini" type="success" >确认预约</el-button>
           <el-button size="mini" type="danger" >确认预约</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 修改一条 -->
    <el-dialog :visible.sync="dialogFormVisible">
      <el-form
        ref="dataForm"
        label-position="left"
        label-width="100px"
        style="width: 400px; margin-left:50px;"
      >
        <el-form-item label="病历号:">
          <el-input />
        </el-form-item>
        <el-form-item label="排班编号:">
          <el-input />
        </el-form-item>
        <el-form-item label="姓名:">
          <el-input />
        </el-form-item>
        <el-form-item label="联系方式:">
          <el-input />
        </el-form-item>
        <el-form-item label="身份证:">
          <el-input />
        </el-form-item>
        <el-form-item label="绿通项目:">
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options "
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="预约编号:">
          <el-input />
        </el-form-item>
        <el-form-item label="时间段:">
          <el-select v-model="values" placeholder="请选择">
            <el-option
              v-for="item in optionss"
              :key="item.values"
              :label="item.label"
              :value="item.values"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="操作员编号:">
          <el-input />
        </el-form-item>
        <el-form-item label="操作平台:">
          <el-input />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">新增</el-button>
      </div>
    </el-dialog>
    <!-- 分页 -->
    <el-col :span="24" class="toolbar" style="text-align: center;">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-count="pageNum"
        :page-size="pagesize"
        style="margin-top:30px;margin-bottom:30px"
        layout="total, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </el-col>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogFormVisible: false,
        tableda: false,
      tableData: [
        {
          preid: "54564212",
          seqNum: "456123",
          mrn: "5645612348456523",
          pbCode: "45645612",
          date: "2019-12-11 08:30",
          name: "张三",
          phoneNum: "13456559464",
          timePart: "上午",
          empid: "515",
          active: "MR平扫绿通",
          platform: "dabay",
          certNum: "154235456135121252"
        },
        {
          preid: "456456",
          seqNum: "54123123",
          mrn: "1166545121233",
          pbCode: "456231",
          date: "2019-12-11 14:20",
          active: "便携睡眠呼吸监测",
          name: "张网",
          phoneNum: "15675122421",
          timePart: "下午",
          empid: "151",
          platform: "dabay",
          certNum: "154235456135121252"
        },
        {
          preid: "8756123",
          seqNum: "45645",
          mrn: "45645123124652",
          pbCode: "45612123",
          date: "2019-12-12 10:40",
          name: "李现",
          phoneNum: "17812238523",
          timePart: "上午",
          empid: "515",
          active: "专家绿通看诊",
          platform: "dabay",
          certNum: "154235456135121252"
        },
        {
          preid: "4562121121",
          seqNum: "65451",
          mrn: "845523123456123123",
          pbCode: "514532",
          date: "2019-12-12 15:10",
          name: "王也",
          phoneNum: "13484231234",
          timePart: "下午",
          active: "大咖门诊绿通",
          empid: "515",
          platform: "dabay",
          certNum: "154235456135121252"
        }
      ],
      currentPage: 1, // 初始页
      pagesize: 10, // 当前页面内的列表行数
      pageCount: 1,
      pageNum: 1, // 页数
      total: 4,
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7;
        }
      },
      value: "1",
      options: [
        {
          value: "1",
          label: "名医门诊绿通"
        },
        {
          values: "2",
          label: "大咖门诊绿通"
        },
        {
          values: "3",
          label: "专家绿通看诊"
        },
        {
          values: "4",
          label: "CT平扫绿通"
        },
        {
          values: "5",
          label: "MR平扫绿通"
        },
        {
          values: "6",
          label: "无痛胃镜/肠镜"
        },
        {
          values: "7",
          label: "无痛胃镜+肠镜"
        },
        {
          values: "8",
          label: "超导睡眠图(PSG)"
        },
        {
          values: "9",
          label: "便携睡眠呼吸监测"
        }
      ],
      optionss: [
        {
          values: "1",
          label: "上午"
        },
        {
          values: "2",
          label: "下午"
        },
        {
          values: "0",
          label: "全部"
        }
      ],
      values: "0"
    };
  },
  methods: {
    //当前页
    handleSizeChange: function(pagesize) {
      this.pagesize = pagesize;
    },
    // 换页：更新列表数据
    handleCurrentChange: function(currentPage) {
      this.currentPage = currentPage;
    },
    creat() {
      this.dialogFormVisible = true;
    }
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
.apply {
  margin-top: 55px;
}
</style>